<?php
class Form_CreateCupKo extends Zend_Form
{
    public function init()
    {
        $this->setAction('/admin/new-cup-ko')
              ->setAttrib('id', 'CreateCupForm')
             ->setMethod('post');
             
        $this->addElement('text', 'cup_name', array(
            'label' => '杯赛淘汰赛名称',
            'validators' => array(
                array('StringLength', true, array(1, 50, 'messages' => array(
                        Zend_Validate_StringLength::TOO_SHORT => '杯赛淘汰赛名称至少需要 %min% 字',
                        Zend_Validate_StringLength::TOO_LONG => '杯赛淘汰赛名称不得超过 %max% 字',
                    ),)),
            	
            		
                
            ),
            'required' => true,
            'filters' => array(
                'StringToLower', 
                'StringTrim'
            ),
            'decorators' => array(
                'ViewHelper',
                'Errors',
                'Label',
                array('HtmlTag', array('tag' => 'div', 'class' => 'formLeagueName')),                
            )
        ));
        
       
        
   
        $this->addElement('radio', 'team_count', array(
        		'label' => '球队数量',
        		
        		//
        		'required' => true,
        		'multiOptions' => array(
        			'4' => '4',
        			'8' => '8',
        			'16' => '16',
        			'32' => '32'
    				),
    			'value' => '4' //key of multiOption
        		)
        	);
           
        $this->addElement('radio', 'type', array(
        		'label' => '循环类型',
        
        		//
        		'required' => true,
        		'multiOptions' => array(
        			'single' => '单循环',
        				'double' => '双循环'        				
        		),
        		'value' => 'single' //key of multiOption
        )
        );
        
        $this->addElement('submit', 'submit',array('label'=>'创建'));
        
        $this->addElement('hidden', 'cible', array(
            'value' => 'create',
			      
        ));
    }
}
